<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>人工影响天气安全射界应用系统</title>
		<link rel="stylesheet" href="js/layui/css/layui.css">
		<link rel="stylesheet" type="text/css" href="css/main.css" />
		<link rel="stylesheet" type="text/css" href="css/ol.css" />
		<link rel="stylesheet" type="text/css" href="css/ssd.min.css" />
		<script src="js/ol.js"></script>
		<script src="js/ssd.min.js"></script>
		<script src="js/jquery-1.10.2.min.js"></script>
		<script src="js/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/index.js"></script>
		<script src="js/WR1D.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/FileSaver.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body class="layui-layout-body" onload="initMap()">
		<div class="layui-layout layui-layout-admin">
			<div class="layui-header layui-bg-blue">
				<div class="layui-logo" style="width:400px;font-size:24px; color: white;">人工影响天气安全射界应用系统</div>
				<ul class="layui-nav layui-layout-right">
					<li class="layui-nav-item">
						<a href="javascript:;">管理员</a>
						<dl class="layui-nav-child">
							<dd><a href="javascript:;">首页</a></dd>
							<dd><a href="javascript:;">修改密码</a></dd>
							<dd><a href="javascript:;">用户管理</a></dd>
						</dl>
					</li>
					<li class="layui-nav-item"><a href="login.html">退出</a></li>
				</ul>
			</div>
			<div class="layui-side layui-bg-cyan" style="width: 300px;">
				<div id="op" style="height: auto%;">
					<div id="shoots"></div>
					<div id="shootarea">
						<div class="areaitem">
							<label>作业点:</label>
							<input id="sationName" type="text" readonly="readonly"class="layui-input"/>
						</div>
						<div class="areaitem">
							<button type="button" id="addPoint" class="layui-btn layui-btn-sm" onclick="addPoint()">新增站点</button>
							<button type="button" id="deletePoint" class="layui-btn layui-btn-sm" onclick="deletePoint()">删除站点</button>
						</div>
						<div class="areaitem">
							<label>射界区编号:</label>
							    <div class="layui-input-inline">
							      <select id="selectNum" onchange="selectItemChange()">
							        <!-- <option value="0"selected="true">请选择编号</option>
							        <option value="1">1</option>
							        <option value="2">2</option>
							        <option value="3">3</option> -->
							      </select>
							    </div>
						</div>
						<div class="areaitem" style="display: none;">
							<label>起始半径(m):</label>
							<input id="startR" type="number" class="layui-input"></input>
						</div>
						<div class="areaitem" style="display: none;">
							<label style="float: left;">结束半径(m):</label>
							<input id="endR" type="number" class="layui-input"></input>
						</div>
						<div class="areaitem">
							<label>起始角度(°):</label>
							<input id="startAngle" type="number" class="layui-input"></input>
						</div>
						<div class="areaitem">
							<label style="float: left;">结束角度(°):</label>
							<input id="endAngle" type="number" class="layui-input"></input>
						</div>
						<div class="areaitem">
							<button type="button" id="addArea" class="layui-btn layui-btn-sm" onclick="pexport()">导出</button>
							<button type="button" id="addArea" class="layui-btn layui-btn-sm" onclick="addArea()">新增</button>
							<button type="button" id="saveArea" class="layui-btn layui-btn-sm" onclick="saveArea()">修改</button>
							<button type="button" id="deleteArea" class="layui-btn layui-btn-sm" onclick="deleteArea()">删除</button>
						</div>
					</div>
					<div class="areaTable">
						<table class="layui-hide" id="tabledata"></table>
					</div>
				</div>
			</div>
			<div class="layui-body" style="bottom:0px;">
				<div id="map" style="width: 100%; height: 100%;"></div>
				<div id="info"></div>
				<div id="outputCanvas" style=" display: none;">	
				</div>
			</div>
			<!--  <div class="layui-footer"></div> -->
		</div>
		<div id="pointAdd">
			<form class="layui-form" id="test" style="display:none">
			  <div class="layui-form-item" style="margin-top: 15px;">
			    <label class="layui-form-label">站点名称</label>
			    <div class="layui-input-block">
			      <input type="text"class="layui-input" id="sname" style="width:200px">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">站点编码</label>
			    <div class="layui-input-block">
			      <input type="text"class="layui-input" id="scode" style="width:200px">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">站点区域</label>
			    <div class="layui-input-inline" style="width: 200px;">
			      <select id="pointArea">
			        <option value="0"selected="true">芒市</option>
			        <option value="1">盈河县</option>
			        <option value="2">梁河县</option>
			        <option value="3">陇川县</option>
					<option value="3">瑞丽市</option>
			      </select>
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">站点经度</label>
				<div class="layui-input-block">
				  <input id="lon" type="number" class="layui-input" style="width: 200px;"></input>
				</div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">站点纬度</label>
				<div class="layui-input-block">
				  <input id="lat" type="number" class="layui-input" style="width: 200px;"></input>
				</div>
			    
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">站点高程</label>
				<div class="layui-input-block">
				   <input id="height" type="number" class="layui-input" style="width: 200px;"></input>
				</div>
			  </div>
			</form>
		</div>
		<script>
			//JavaScript代码区域
			layui.use('element', function() {
				var element = layui.element;
		
			});
			function addPoint(){
				layer.open({
				 type:1,
				 area:['400px','440px'],
				  title: '新增站点'
				  ,content: $("#test"),
				  shade: 0,
				  btn: ['提交', '重置']
				  ,btn1: function(index, layero){
					var sname=$("#sname").val();
					var scode=$("#scode").val();
					var lon=$("#lon").val();
					var lat=$("#lat").val();
					var height=$("#height").val();
					var city = $("#pointArea").find("option:selected").text();
					if(sname==undefined||sname==""||scode==undefined||scode==""||lon==undefined||lat==undefined||height==undefined){
						alert("请正确填写站点信息");
						return false;
					}
					var obj={"sname": sname,
						"scode": scode,
						"lon": Number(lon),
						"lat": Number(lat),
						"height": Number(height),
						"high": 6000,
						"radius": 8000,
						"ztool": "火箭",
						"city": city,"data":[]};
						
					//var DataObj=JSON.parse(allDatas);
					allDatas.push(obj);
					updateAlldate(allDatas);
					alert('添加成功');
					layer.closeAll();
				  },
				  btn2: function(index, layero){
				   return false;
				  },
				cancel: function(layero,index){ 
				   layer.closeAll();
				  }
				
				}); 
			}
		</script>
	</body>
</html>
